package com.feihao.zhou.service.impl;

import com.feihao.zhou.bean.Account;
import com.feihao.zhou.dao.AccountDao;
import com.feihao.zhou.service.AccountService;

import java.util.List;

public class AccountServiceImpl implements AccountService {
    private AccountDao accountDao;

    //添加set方法，让spring注入bean
    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }

    public Integer save(Account account) {
        return accountDao.save(account);
    }

    public Integer delete(Integer id) {
        return accountDao.delete(id);
    }

    public Integer update(Account account) {
        return accountDao.update(account);
    }

    public List<Account> findAll() {
        return accountDao.findAll();
    }

    public Account findById(Integer id) {
        return accountDao.findById(id);
    }
}
